﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HotelBookingSystem
{
    public class Client
    {
        public int ClientId { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string EmailAddress { get; set; }

        static private int nextCustId = 1;

        public Client(string fname, string lname, string email)
        {
            ClientId = nextCustId++;
            FirstName = fname;
            LastName = lname;
            EmailAddress = email;
        }

        public Client(int id)
        {
            ClientId = id;
            FirstName = "";
            LastName = "";
            EmailAddress = "";
        }
        public override bool Equals(object obj)
        {
            Client client = (Client)obj;
            return (client.ClientId == ClientId);
        }
        public override int GetHashCode()
        {
            return (ClientId.GetHashCode());
        }

        public override string ToString()
        {
            return FirstName + " " + LastName;
        }
    }
}
